package com.yonyou.cyxdms.sysAuth.service.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;

/**
 * <p>
 * 页面字段权限配置
 * </p>
 *
 * @author quankk
 * @since 2019-07-05
 */
@TableName("tc_page_field")
public class PageFieldPO extends DMSBasePO<PageFieldPO> {

    private static final long serialVersionUID = 1L;

    /**
     * 字段ID
     */
        @TableId(value = "FIELD_ID", type = IdType.AUTO)
        private Integer fieldId;
    /**
     * 经销商代码
     */
    @TableField("DEALER_CODE")
    private String dealerCode;
    /**
     * 页面ID
     */
    @TableField("PAGE_ID")
    private Integer pageId;
    /**
     * 字段唯一标识（用户页面验证）
     */
    @TableField("FIELD_KEY")
    private String fieldKey;
    /**
     * 字段名称
     */
    @TableField("FIELD_NAME")
    private String fieldName;
    /**
     * 字段描述
     */
    @TableField("FIELD_DESC")
    private String fieldDesc;
    /**
     * 字段类型：如字段是否必选，字段是否显示
     */
    @TableField("FIELD_TYPE")
    private Integer fieldType;
    /**
     * 是，否启用权限控制
     */
    @TableField("PERMISSION_CTL")
    private Integer permissionCtl;
    /**
     * 是否启用
     */
    @TableField("IS_ENABLE")
    private Integer isEnable;
    /**
     * 开发人员
     */
    @TableField("OWNER")
    private String owner;
    @TableField("IS_DELETED")
    @Version
    @TableLogic
    private Boolean isDeleted;

    public PageFieldPO() {
        super();
    }


    public Integer getFieldId() {
        return fieldId;
    }

    public void setFieldId(Integer fieldId) {
        this.fieldId = fieldId;
    }

    public String getDealerCode() {
        return dealerCode;
    }

    public void setDealerCode(String dealerCode) {
        this.dealerCode = dealerCode;
    }

    public Integer getPageId() {
        return pageId;
    }

    public void setPageId(Integer pageId) {
        this.pageId = pageId;
    }

    public String getFieldKey() {
        return fieldKey;
    }

    public void setFieldKey(String fieldKey) {
        this.fieldKey = fieldKey;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public String getFieldDesc() {
        return fieldDesc;
    }

    public void setFieldDesc(String fieldDesc) {
        this.fieldDesc = fieldDesc;
    }

    public Integer getFieldType() {
        return fieldType;
    }

    public void setFieldType(Integer fieldType) {
        this.fieldType = fieldType;
    }

    public Integer getPermissionCtl() {
        return permissionCtl;
    }

    public void setPermissionCtl(Integer permissionCtl) {
        this.permissionCtl = permissionCtl;
    }

    public Integer getIsEnable() {
        return isEnable;
    }

    public void setIsEnable(Integer isEnable) {
        this.isEnable = isEnable;
    }

    public String getOwner() {
        return owner;
    }

    public void setOwner(String owner) {
        this.owner = owner;
    }

    public Boolean getDeleted() {
        return isDeleted;
    }

    public void setDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    protected Serializable pkVal() {
        return this.fieldId;
    }

    @Override
    public String toString() {
        return "PageFieldPO{" +
        "fieldId=" + fieldId +
        ", dealerCode=" + dealerCode +
        ", pageId=" + pageId +
        ", fieldKey=" + fieldKey +
        ", fieldName=" + fieldName +
        ", fieldDesc=" + fieldDesc +
        ", fieldType=" + fieldType +
        ", permissionCtl=" + permissionCtl +
        ", isEnable=" + isEnable +
        ", owner=" + owner +
        ", isDeleted=" + isDeleted +
        "}";
    }


    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author quankk
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "fieldId");
    }


}
